package com.chixing.dao.impl;

import com.chixing.dao.RowMapper;
import com.chixing.entity.Department;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DepartmentRowMapper implements RowMapper<Department> {

    public Department mapper(ResultSet rs) {
        Department department = null;
       try {
           int deptNo = rs.getInt(1);
           String deptName = rs.getString(2);
           String loc = rs.getString(3);
           department = new Department(deptNo, deptName, loc);
       } catch (Exception e) {
        e.printStackTrace();
    }
        return department;
    }
}
